from pylab import *
import numpy as np
import cv2
import time

from yolo.net import Yolo

model_yolo = {}

def init():
    global model_yolo
    model_yolo = Yolo("./config_demo.json")

def probe_mat(im):
    xyc_pack = model_yolo.predict(im, show_im=False)
    return xyc_pack

if __name__ == '__main__':
    init()
    im = cv2.imread('test_im1080.jpg')
    print("time:{} shape:{}".format(time.time(), im.shape))
    xyc_pack = model_yolo.predict(im, show_im=True)
    print(xyc_pack)
    print("num car detected: {}".format(len(xyc_pack)))